<script setup lang="ts">

import 'dayjs/locale/zh-cn';
import zhCn from 'tdesign-mobile-vue/es/locale/zh_CN';
function forbiddenTouches() {
  document.addEventListener('DOMContentLoaded', function () {
    var lastTouchEnd = 0;
    document.body.addEventListener('touchstart', function (e) {
      if (e.targetTouches.length > 1) {
        e.preventDefault();
      }
    }, { passive: false });

    document.body.addEventListener('touchend', function (e) {
      var now = (new Date()).getTime();
      if (now - lastTouchEnd <= 300) {
        e.preventDefault();
      }
      lastTouchEnd = now;
    }, { passive: false });

    document.body.addEventListener('gesturestart', function (e) {
      e.preventDefault();
    });
  });
}
forbiddenTouches();
</script>

<template>
  <t-config-provider :global-config="zhCn">
    <RouterView v-slot='{ Component }'>
      <template v-if='Component'>
        <Suspense>
          <component :is='Component'></component>
        </Suspense>
      </template>
    </RouterView>
  </t-config-provider>

</template>

<style scoped></style>
